/*
 * @Date: 2023-02-27 18:19:43
 * @LastEditTime: 2023-02-27 18:23:57
 * @FilePath: /hash-guess-game/src/api/module/userInfo.ts
 * 介绍:
 */
import { defaHttp, ApiRes, ApiReturn } from "../index";

/**用户信息 */
export async function apiUserInfo(): ApiReturn<UserInfo.Res> {
  const res = await defaHttp.post<ApiRes<UserInfo.Res>>("/user/me");
  if (res.code !== 200) return;
  return res.data;
}
/**用户信息 */
export namespace UserInfo {
  export interface Res {
    id: Id;
    name: string;
    email: string;
    email_verified_at: string | null;
    created_at: string | Date;
    updated_at: string | Date;
    /**0未备份助记词；1已备份助记词 */
    is_backup: number;
    address: string;
    /**邀请码 */
    invit: string;
    parent_id: number;
    /**助记词 */
    level: number;
    that_wallet_name: string;
    share_level: number;
    have_transfer: number;
    old_user_id: number;
    old_parent_id: number;
    is_red: number;
    remark: null;
    tpversion: null;
    solana_address: string;
    /**0未设置安全密码；1：已设置安全密码 */
    is_set_pay_password: number;
    /**是否有NFT 1是有；0 就是没有 */
    is_nft: number;
  }
}
